AUX_SOURCE_DIRECTORY(. SHM_SRC)

LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})

FILE(GLOB SHM_INCLUDE ./*.h)

ADD_LIBRARY(${SHM_SHARED} SHARED ${SHM_SRC})
ADD_LIBRARY(${SHM_STATIC} STATIC ${SHM_SRC})

TARGET_LINK_LIBRARIES(${SHM_SHARED} ${GLOBAL_SHARED} -lrt)

INSTALL(TARGETS ${SHM_SHARED} LIBRARY DESTINATION lib)
INSTALL(TARGETS ${SHM_STATIC} ARCHIVE DESTINATION lib)
INSTALL(FILES ${SHM_INCLUDE} DESTINATION include/shm)

SET_TARGET_PROPERTIES(${SHM_SHARED} PROPERTIES OUTPUT_NAME "TimepassShm")
SET_TARGET_PROPERTIES(${SHM_STATIC} PROPERTIES OUTPUT_NAME "TimepassShm")